#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e6+1000;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
char str[maxn];
bool vis[maxn];
int main(void){
   cin.tie(0);std::ios::sync_with_stdio(false);
   cin>>(str+1);
   LL n=strlen(str+1);
   LL l=1,r=n;
   while(r>l){
       if(r-l+1<4){
          for(LL i=l;i<=r;i++){
            if(!vis[i]) {vis[i]=1;break;}
          }
          break;
       }
       if(str[l]==str[r]){
          vis[l]=vis[r]=1;
          l++;r--;
       }
       else if(str[l+1]==str[r]){
          vis[l+1]=vis[r]=1;
          l+=2;r--;
       }
       else if(str[l]==str[r-1]){
          vis[l]=vis[r-1]=1;
          l++;r-=2;
       }
       else if(str[l+1]==str[r-1]){
          vis[l+1]=vis[r-1]=1;
          l+=2;r-=2;
       }
   }
   for(LL i=1;i<=n;i++){
       if(vis[i]){
          cout<<str[i];
       }
   }
   cout<<"\n";
   return 0;
}
